<template>
	<view class="pageItem">
		<map class="map" :latitude="lat" :longitude="lng" scale="14" :markers="covers"></map>
		<view class="address">
			<view class="title">自提网点地址</view>
			<view class="txt">{{address}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lat:'',
				lng:'',
				address:'',
				covers: []
			};
		},
		onLoad(e) {
			let that = this;
			const eventChannel = this.getOpenerEventChannel();
			eventChannel.on('acceptDataFromOpenerPage', function(data) {
			    //console.log(data)
				that.lat = data.lat;
				that.lng = data.lng;
				that.address = data.address;
				that.covers = [{latitude:data.lat,longitude:data.lng,iconPath: '../../static/location.png'}]
			})
		}
	}
</script>

<style lang="scss">
.map{
	width: 100%;
	height: calc(75vh - 44px);
}
.address{
	width: 100%;
	height: 25vh;
	background: #ffffff;
	display: flex;
	flex-direction: column;
	.title{
		font-size: 28rpx;
		font-weight: bold;
		padding: 40rpx 30rpx;
	}
	.txt{
		flex: 1;
		font-size: 30rpx;
		line-height: 32rpx;
		color: #626262;
		padding: 20rpx 30rpx;
	}
}
</style>
